/**
 * <pre>
 * ss-fire-collector / TaskConstVO.java
 * collector.core Class
 * TaskConstVO
 * <br>
 * 
 * <br>
 * @author ytjeong/apexcns,Inc.
 * @version 1.0
 * @see javadoc
 * @since 2012. 9. 12.
 * </pre>
 */
package collector.core;

import net.apexcns.core.util.StringUtil;

/** <pre>
 * Class : collector.core.TaskConstVO / TaskConstVO.java
 * 	Define Class Object : Task Constants read 정의 객체
 * 	XML Config에서 load 된 정보를 담는다.
 * <br>
 * </pre>
 * @author ytjeong / apexcns,Inc.
 * @version 1.0
 * @see javadoc
 * @since 2012. 9. 12.
 */

public class TaskConstVO {
	protected String taskName	= null;
    protected String taskIdx	= null;
    protected String useYN	= null;

    protected String scheduleDateStr	= null;
    protected String durationType	= null;
    protected int durationValue	= -1;
    
    protected String taskGroup	= null;
    protected String taskClassStr	= null;
    //protected Class<?> taskClass	= null;	// Auto Generate
    
    protected String taskPathCurrent	= null;
    protected String taskPathHistory	= null;
    protected String taskPathState	= null;

    public TaskConstVO(String taskName, String taskIdx, String useYN, String taskPathCurrent, 
    		String taskPathHistory, String taskPathState, String taskGroup, String taskClassStr, String scheduleDateStr, 
    		String durationType, int durationValue) {
		super();
		this.taskName = taskName;
		this.taskIdx = taskIdx;
		this.useYN	= useYN;
		this.taskPathCurrent = taskPathCurrent;
		this.taskPathHistory = taskPathHistory;
		this.taskPathState = taskPathState;
		this.taskGroup = taskGroup;
		this.taskClassStr = taskClassStr;
		this.scheduleDateStr = scheduleDateStr;
		this.durationType = durationType;
		this.durationValue = durationValue;
		
		if ( StringUtil.isEmpty(this.taskClassStr) ) this.taskClassStr = CollectConstants.DEFAULT_TASK_CLASSSTR;
//		try {
//		    this.taskClass	= Class.forName(this.taskClassStr);
//		} catch (ClassNotFoundException e) {
//		    //e.printStackTrace();
//		    try {
//			this.taskClass	= Class.forName("collector.module.ModuleJob");
//		    } catch (ClassNotFoundException e1) {
//			e1.printStackTrace();
//		    }
//		}
    }
    
    /** <pre>
     * Method : TaskConstVO.getTaskName()
     * 	to get taskName
     * <br> 
     * @return the taskName : type of String
     * </pre>
     */
    public String getTaskName() {
        return taskName;
    }
    /** <pre>
     * Method : TaskConstVO.setTaskName()
     * 	to set taskName 
     * <br> 
     * @param taskName : type of String
     * </pre>
     */
    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }
    /** <pre>
     * Method : TaskConstVO.getTaskIdx()
     * 	to get taskIdx
     * <br> 
     * @return the taskIdx : type of String
     * </pre>
     */
    public String getTaskIdx() {
        return taskIdx;
    }
    /** <pre>
     * Method : TaskConstVO.setTaskIdx()
     * 	to set taskIdx 
     * <br> 
     * @param taskIdx : type of String
     * </pre>
     */
    public void setTaskIdx(String taskIdx) {
        this.taskIdx = taskIdx;
    }
    /** <pre>
     * Method : TaskConstVO.getTaskPathCurrent()
     * 	to get taskPathCurrent
     * <br> 
     * @return the taskPathCurrent : type of String
     * </pre>
     */
    public String getTaskPathCurrent() {
        return taskPathCurrent;
    }
    /** <pre>
     * Method : TaskConstVO.setTaskPathCurrent()
     * 	to set taskPathCurrent 
     * <br> 
     * @param taskPathCurrent : type of String
     * </pre>
     */
    public void setTaskPathCurrent(String taskPathCurrent) {
        this.taskPathCurrent = taskPathCurrent;
    }
    /** <pre>
     * Method : TaskConstVO.getTaskPathHistory()
     * 	to get taskPathHistory
     * <br> 
     * @return the taskPathHistory : type of String
     * </pre>
     */
    public String getTaskPathHistory() {
        return taskPathHistory;
    }
    /** <pre>
     * Method : TaskConstVO.setTaskPathHistory()
     * 	to set taskPathHistory 
     * <br> 
     * @param taskPathHistory : type of String
     * </pre>
     */
    public void setTaskPathHistory(String taskPathHistory) {
        this.taskPathHistory = taskPathHistory;
    }
    /** <pre>
     * Method : TaskConstVO.getTaskGroup()
     * 	to get taskGroup
     * <br> 
     * @return the taskGroup : type of String
     * </pre>
     */
    public String getTaskGroup() {
        return taskGroup;
    }
    /** <pre>
	 * Method : TaskConstVO.getTaskPathState()
	 * 	to get taskPathState
	 * <br> 
	 * @return the taskPathState : type of String
	 * </pre>
	 */
	public String getTaskPathState() {
		return taskPathState;
	}
	/** <pre>
	 * Method : TaskConstVO.setTaskPathState()
	 * 	to set taskPathState
	 * <br> 
	 * @return the taskPathState : type of String
	 * </pre>
	 */
	public void setTaskPathState(String taskPathState) {
		this.taskPathState = taskPathState;
	}
	/** <pre>
     * Method : TaskConstVO.setTaskGroup()
     * 	to set taskGroup 
     * <br> 
     * @param taskGroup : type of String
     * </pre>
     */
    public void setTaskGroup(String taskGroup) {
        this.taskGroup = taskGroup;
    }
    /** <pre>
     * Method : TaskConstVO.getTaskClassStr()
     * 	to get taskClassStr
     * <br> 
     * @return the taskClassStr : type of String
     * </pre>
     */
    public String getTaskClassStr() {
        return taskClassStr;
    }
    /** <pre>
     * Method : TaskConstVO.setTaskClassStr()
     * 	to set taskClassStr 
     * <br> 
     * @param taskClassStr : type of String
     * </pre>
     */
    public void setTaskClassStr(String taskClassStr) {
        this.taskClassStr = taskClassStr;
        
//	try {
//	    this.taskClass	= Class.forName(this.taskClassStr);
//	} catch (ClassNotFoundException e) {
//	    //e.printStackTrace();
//	    try {
//		this.taskClass	= Class.forName("collector.module.ModuleJob");
//	    } catch (ClassNotFoundException e1) {
//		e1.printStackTrace();
//	    }
//	}
        
    }
//    /** <pre>
//     * Method : TaskConstVO.getTaskClass()
//     * 	to get taskClass
//     * <br> 
//     * @return the taskClass : type of Class<?>
//     * </pre>
//     */
//    public Class<?> getTaskClass() {
//        return taskClass;
//    }
//    /** <pre>
//     * Method : TaskConstVO.setTaskClass()
//     * 	to set taskClass 
//     * <br> 
//     * @param taskClass : type of Class<?>
//     * </pre>
//     */
//    public void setTaskClass(Class<?> taskClass) {
//        this.taskClass = taskClass;
//    }
    /** <pre>
     * Method : TaskConstVO.getScheduleDateStr()
     * 	to get scheduleDateStr
     * <br> 
     * @return the scheduleDateStr : type of String
     * </pre>
     */
    public String getScheduleDateStr() {
        return scheduleDateStr;
    }
    /** <pre>
     * Method : TaskConstVO.setScheduleDateStr()
     * 	to set scheduleDateStr 
     * <br> 
     * @param scheduleDateStr : type of String
     * </pre>
     */
    public void setScheduleDateStr(String scheduleDateStr) {
        this.scheduleDateStr = scheduleDateStr;
    }
    /** <pre>
     * Method : TaskConstVO.getDurationType()
     * 	to get durationType
     * <br> 
     * @return the durationType : type of String
     * </pre>
     */
    public String getDurationType() {
        return durationType;
    }
    /** <pre>
     * Method : TaskConstVO.setDurationType()
     * 	to set durationType 
     * <br> 
     * @param durationType : type of String
     * </pre>
     */
    public void setDurationType(String durationType) {
        this.durationType = durationType;
    }
    /** <pre>
     * Method : TaskConstVO.getDurationValue()
     * 	to get durationValue
     * <br> 
     * @return the durationValue : type of int
     * </pre>
     */
    public int getDurationValue() {
        return durationValue;
    }
    /** <pre>
     * Method : TaskConstVO.setDurationValue()
     * 	to set durationValue 
     * <br> 
     * @param durationValue : type of int
     * </pre>
     */
    public void setDurationValue(int durationValue) {
        this.durationValue = durationValue;
    }
    /** <pre>
     * Method : TaskConstVO.getUseYN()
     * 	to get useYN
     * <br> 
     * @return the useYN : type of String
     * </pre>
     */
    public String getUseYN() {
        return useYN;
    }
    /** <pre>
     * Method : TaskConstVO.setUseYN()
     * 	to set useYN 
     * <br> 
     * @param useYN : type of String
     * </pre>
     */
    public void setUseYN(String useYN) {
        this.useYN = useYN;
    }
 
    /**
     * <pre>
     * Method : TaskConstVO.viewJobSchedule()
     * 
     * <br>
     * 	return type of String
     * <br>
     * @return 
     * </pre>
     */
    public String viewJobSchedule() {
	    return taskName + ", " + taskIdx +
		    		" will run at: " + scheduleDateStr +
		                " every " + durationValue + " " + durationType + "," +
		                " run class: " + taskClassStr +
		                " original: " + taskPathCurrent +
		                " history: " + taskPathHistory ;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString() 
     * 
     * Method : collector.core.TaskConstVO.toString()
     */
    @Override
    public String toString() {
	StringBuilder builder = new StringBuilder();
	builder.append("TaskConstVO [taskName=").append(taskName)
		.append(", taskIdx=").append(taskIdx)
		.append(", useYN=").append(useYN)
		.append(", scheduleDateStr=").append(scheduleDateStr)
		.append(", durationType=").append(durationType)
		.append(", durationValue=").append(durationValue)
		.append(", taskGroup=").append(taskGroup)
		.append(", taskClassStr=").append(taskClassStr).append("\n\t\t")
		.append(", taskPathCurrent=").append(taskPathCurrent)
		.append(", taskPathHistory=").append(taskPathHistory)
		.append("]").append("\n\t");
	return builder.toString();
    }
}